<div class="m-hd">
  <div class="title">
    <h1>站内短信</h1>
    <div class="small">Member</div>
  </div>
  <div class="f-cb"></div>
</div>
<div class="m-tab">
  <div class="more"><a href="{$url|'member/Message/send'}">+ 写新消息</a></div>
  <ul>
    <li {if="$_GET['type']==0"} class="z-crt" {/if} ><a href="<?php echo url('member/Message/index'); ?>">收件箱</a></li>
    <li {if="$_GET['type']==1"} class="z-crt" {/if} ><a href="<?php echo url('member/Message/index',array('type'=>1)); ?>">系统消息</a></li>
    <li {if="$_GET['type']==2"} class="z-crt" {/if} ><a href="<?php echo url('member/Message/index',array('type'=>2)); ?>">发件箱</a></li>
  </ul>
</div>
<table class="m-table" id="table">
  <tbody>
    <!--{loop="$list $vo"}-->
    <tr>
    	
      {if="$_GET['type']<>2"}
      {if="$vo['read_status']"}
      <td width="20"><img src="__PUBLICAPP__/images/ico4.png" width="16" height="16" /></td>
      {else}
      <td width="20"><img src="__PUBLICAPP__/images/ico3.png" width="16" height="16" /></td>
      {/if}
      {/if}
      <td width="20"><input name="id[]" type="checkbox" value="{$vo.msg_id}" /></td>
      <td> {if="!$_GET['type']"}
        <div>{$vo.send_username}</div>
        {elseif="$_GET['type']==2"}
        <div>{$vo.receive_username}</div>
        {/if} <a href="<?php echo url('member/Message/info',array('msg_id'=>$vo['msg_id'],'type'=>$_GET['type'])); ?>">{$vo.title}</a></td>
      <td class="colb">{$vo.time|format_time:'Y-m-d H:i:s'}</td>
    </tr>
    <!--{/loop}-->
  </tbody>
</table>
<div class="m-page">
  <div class="tool"> <label><input type="checkbox" class="select" id="selectAll" />全选</label> <span class="line">|</span>  <a href="javascript:;" id="del">删除</a> </div>
  <div class="page">{$page}</div>
  <div class="f-cb"></div>
</div>
<script>

Do.ready('base','dialog',function() {
	$('#table').duxTable({selectAll:'#selectAll'});
	$('#del').duxAjaxConfirm({
		url : '{$url|"member/Message/del"}',
		content : '您确认要进行删除操作吗？',
		params : function(){
				var valueArr = '';
				$("input[name='id[]']:checked").each(function(i){
					valueArr += $(this).val();
					if(i < $("input[name='id[]']:checked").length - 1){
						valueArr += ","
					}
				});
				return {
					'id':valueArr,
					'type':'{$_GET.type}'
				};
			},
		complete : function(){
			setTimeout(function(){window.location.reload();},2000);
		}
	});
});
</script>
